// by Xeno
#define THIS_FILE "fn_checkhelipilotout.sqf"
#include "x_setup.sqf"
private ["_vehicle","_position","_enterer"];

_enterer = _this select 2;
if (_enterer != player) exitWith {};

PARAMS_2(_vehicle,_position);

if (_position == "driver" && {__pGetVar(GVAR(hud_id)) != -1000}) then {
	_vehicle removeAction __pGetVar(GVAR(hud_id));
	__pSetVar [QGVAR(hud_id), -1000];
	// TYRGHEN
	if (isEngineOn (_vehicle) && isNull(driver _vehicle)) then {
		_vehicle engineOn false;
	};
};